﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;


namespace Bussiness.Service
{
    public class Appcontex
    {
        //thong tin chung
        private string tenDangNhap;

        public string TenDangNhap
        {
            get { return tenDangNhap; }
            set { tenDangNhap = value; }
        }
        private int id;

        public int Id
        {
            get { return id; }
            set { id = value; }
        }
        private string matKhau;

        public string MatKhau
        {
            get { return matKhau; }
            set { matKhau = value; }
        }
        private bool isAdmin;

        public bool IsAdmin
        {
            get { return isAdmin; }
            set { isAdmin = value; }
        }


        public Appcontex(string tenDangNhap)
        {
            User nsd = new User_Service().searchVATNSD_ByTenNSD(tenDangNhap);

            if (nsd != null)
            {
                this.id = nsd.Id;
                this.isAdmin =(bool) nsd.IsAdmin;
                this.tenDangNhap = nsd.User1;
                this.matKhau = nsd.Pass;
            }
        }

       
    }
}
